<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="theme-color" content="#1976d2">
    <title>pwa</title>
    <link rel="manifest" href="./manifest.json">
    <script src="./index.js" type="text/javascript" charset="utf-8"></script>
    <script crossorigin="anonymous"  src="https://lib.baomitu.com/axios/0.21.1/axios.min.js"></script>
  </head>
  <body>
    <h1>pwa sw</h1>
    <img src="./icons/logo.png" >
  </body>
</html>
<script>
if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('./sw.js').then(reg => {//Service Worker 注册的 path 为 /a/b/sw.js，则 scope 作用域 默认为 /a/b/。
        console.log('service worker registed!');
        console.log(reg)
    }).catch(err => {
        console.log('Opooos, something wrong happend!');
    })
}

axios.post('http://114.215.192.141:15888/api/daohang_getList',{"params":{"limit":100}}).then(p=>{
  console.log(p)
})

</script>